package com.squirrel.michale;

import java.util.Arrays;

/**
 * @author guanhao 观浩
 * @version 1.0.0.0
 * @createTime 2023/2/5 8:11 AM
 * @company Michale Squirrel
 * @link
 * @description
 */
public class LeetCode1798 {

    public int getMaximumConsecutive(int[] coins) {
        int m = 0;
        Arrays.sort(coins);
        for (int c : coins) {
            if (c > m + 1){
                break;
            }
            m += c;
        }
        return m + 1;

    }
}
